<!DOCTYPE html>
<html lang="en">
<head>
  <title>浩然金融中心管理平台</title>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"
        name="viewport">
  <#include "/common/csslib.html">
</head>
<body>
<div class="main-wrapper">
  <!-- start: MAIN CONTAINER -->
  <div class="main-container inner">
    <!-- start: PAGE -->
    <div class="main-content">
      <div class="container">
        <div class="row h-main-search">
          <form action="javascript:;" method="post">
            <div class="pull-right h-btn-group">
              <button class="btn btn-info" id="save" onclick="SystemDictMgr.submitForm()" type="button"><i
                      class="fa fa-save">&nbsp;&nbsp;</i>保存
              </button>
            </div>
          </form>
        </div>
        <div class="form-horizontal  h-form-warp">
          <form action="/systemDict/saveSystemDict" class="form-horizontal" id="systemDictForm" method="post"
                role="form">
            <input id="operation" name="operation" type="hidden" value="${operation!}"/>
            <input id="id" name="id" type="hidden" value="${systemDict.id!}"/>
            <input id="parentId" name="parentId" type="hidden" value="${systemDict.parentId!}"/>
            <div class="form-group">
              <label class="col-sm-2 col-xs-2 control-label text-right">编码：</label>
              <div class="col-sm-6 col-xs-6">
                <input class="form-control" id="itemName" name="itemName" required="required"
                       type="text" value="${systemDict.itemName!}"/>
              </div>
              <label class="required col-xs-1 col-sm-1">*</label>
            </div>
            <div class="form-group">
              <label class="col-sm-2 col-xs-2 control-label text-right">值：</label>
              <div class="col-sm-6 col-xs-6">
                <input class="form-control" id="itemValue" name="itemValue" required="required"
                       type="text" value="${systemDict.itemValue!}"/>
              </div>
              <label class="required col-sm-1 col-xs-1">*</label>
            </div>
            <div class="form-group">
              <label class="col-sm-2 col-xs-2 control-label text-right">说明：</label>
              <div class="col-sm-6 col-xs-6">
                <input class="form-control" id="dictComment" name="dictComment" required="required"
                       type="text" value="${systemDict.dictComment!}"/>
              </div>
              <label class="required col-sm-1 col-xs-1">*</label>
            </div>
          </form>
        </div>
      </div>
    </div>
    <!-- end: PAGE -->
  </div>
  <!-- end: MAIN CONTAINER -->
</div>
<#include "/common/jslib.html">
<!-- form页面js -->
<script type="text/javascript">
    $(function () {
        // 页面操作类型：add(添加)-edit(编辑)-view(查看)
        var operation = $("#operation").val();
        var api = frameElement.api, W = api.opener;
        SystemDictMgr = {
            // 初始化
            init: function () {
                // 查看的时候不显示保存按钮
                if (operation == "view") {
                    Jmts.setFormReadOnly();
                    $("#save").hide();
                }
                api.button({
                    id: 'cancel',
                    name: '关闭'
                });
            },
            // init end

            // 提交数据
            submitForm: function () {
                Jmts.ajaxSubmit(document.getElementById("systemDictForm"), function (result) {
                    var operation = result.operation;
                    if (result.success) {
                        if (operation == 'add') {
                            W.Jmts.succTips(result.msg);
                            api.close();
                            W.location.reload();
                        } else if (operation == 'edit') {
                            W.location.reload();
                            W.Jmts.succTips(result.msg);
                        }
                    } else {
                        Jmts.errorTips(result.msg);
                    }
                });
                return false;
            }
            // submitForm end
        };
        // 执行初始化
        SystemDictMgr.init();
        // 前台验证表单
        $("#systemDictForm").validate();
    });
</script>
</body>
</html>
